//
//  BaseOperator.m
//  CToolBox
//
//  Created by SC on 16/12/14.
//  Copyright © 2016年 SC. All rights reserved.
//

#import "BaseOperator.h"

NSString *DTODataKey = @"Data";
NSString *DTOPageInfoKey = @"PageInfo";
NSString *DTOActionKey = @"Action";

@implementation BaseOperator

- (void)setHostWithPath:(NSString *)path
{
    self.apiArea = [kBaseUrl stringByAppendingPathComponent:path];
}

- (NSString *)getUrlWithMethod:(NSString *)method
{
    NSString *url = [self.apiArea stringByAppendingPathComponent:method];
    return url;
}



#pragma mark - CTVisitorDelegate

- (void)visitorRequestEnd
{
    if ([_delegate respondsToSelector:@selector(operatorRequestEnd)]) {
        [_delegate operatorRequestEnd];
    }
}

- (void)visitorExistErrorWithNo:(int)ErrorNo Message:(NSString *)ErrorMessage
{
    if ([_delegate respondsToSelector:@selector(operatorExistErrorWithNo:Message:)]) {
        [_delegate operatorExistErrorWithNo:ErrorNo Message:ErrorMessage];
    }
}

- (void)visitorRequestFailure
{
    if ([_delegate respondsToSelector:@selector(operatorRequestFailure)]) {
        [_delegate operatorRequestFailure];
    }
}


@end
